package com.mer.controller;

import com.mer.service.TeacherExamineService;
import com.mer.vo.CommonResult;
import com.mer.vo.TeacherExamineVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @program: IIPhase-project
 * @description: 教师审核控制层
 * @author: 张庆恒
 * @create: 2021-10-20 15:24
 **/
@RestController
@RequestMapping("/core/checkTeacher")
@Api(tags = "教师管理-讲师审核")
public class TeacherExamineController {

    @Resource
    private TeacherExamineService teacherExamineService;


    @PostMapping("/queryNotApprovedTeacher/{page}/{limit}")
    @ApiOperation("分页查询全部教师")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "page", value = "当前页数"),
            @ApiImplicitParam(name = "limit", value = "每页条数")
    })
    public CommonResult queryNotApprovedTeacher(
            @PathVariable("page") Integer page,
            @PathVariable("limit") Integer limit,
            @RequestBody TeacherExamineVo teacherExamineVo
    ) {
        return teacherExamineService.queryNotApprovedTeacher(page, limit, teacherExamineVo);
    }

    @PostMapping("/teacherExamine")
    @ApiOperation("审核讲师")
    public CommonResult teacherExamine(@RequestBody TeacherExamineVo teacherExamineVo) {
        System.out.println(teacherExamineVo);
        return teacherExamineService.changeTeacherApproved(teacherExamineVo);
    }
}
